package dierweek;

import java.util.Scanner;

public class nianking {
    public static void main(String[] args) {
        int newy,newm,newd,birthy,birthm,birthd;
        Scanner scanner = new Scanner(System.in);
        System.out.println("输入你出生的年份");
        birthy= scanner.nextInt();
        System.out.println("输入你出生的月份");
        birthm= scanner.nextInt();
        System.out.println("输入你出生的日份");
        birthd= scanner.nextInt();
        System.out.println("输入你现在的年份");
        newy= scanner.nextInt();
        System.out.println("输入你现在的月份");
        newm= scanner.nextInt();
        System.out.println("输入你现在的日份");
        newd= scanner.nextInt();
        int age;
        if (newm>=birthm &&newd>=birthd){
            age=newy-birthy;
        }else{
            age=newy-birthy-1;
        }
        System.out.println("age="+age);
    }
}
